package cn.edu.sdjzu.xg.bysj.security;


import java.io.Serializable;
import java.time.LocalDateTime;


public class User implements Comparable<User>, Serializable {
    private Integer id;
    private String username;
    private String password;
    private LocalDateTime loginTime;
    private Actor actor;

    //用户仅处理参与者自身信息时，比如读出一个学生或教师的基本信息（不必含有用户名和密码）
    public User(Integer id) {
        this.id = id;
    }

    //用于修改密码时
    public User(Integer id, String username, String password) {
        this.id = id;
        this.username = username;
        this.password = password;
    }
    //登录验证时，读出所有信息
    public User(Integer id, String username, String password, Actor actor) {
        this.id = id;
        this.username = username;
        this.password = password;
        this.actor = actor;
    }

    @Override
    public int compareTo(User o) {
        // TODO Auto-generated method stub
        return this.id - o.id;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }


    public static void main(String[] args) {
        User user = new User(1,"s1","b");
        System.out.println(user.toString());
    }
}
